package com.itheima.mapper;

import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface UserMapper {
    @Select("select * from user where id=#{id}")
    User findById(Integer id);

    @Delete("delete from user where id=#{id}")
    int deleteById(Integer id);

    @Insert("insert into user values (null,#{name},#{password})")
    int insert(User user);

    @Update("update user set name=#{name} where id =#{id}")
    int update(User user);

}
